package com.itboye.mengwu.data.repository;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.mengwu.data.interfaces.ILunBo;
import com.itboye.mengwu.data.interfaces.IShopCar;
import com.itboye.mengwu.data.model.AddGoodsBean;
import com.itboye.mengwu.data.model.AppHeadPage;
import com.itboye.mengwu.data.model.HomePageModel;
import com.itboye.mengwu.data.model.IndexModel;
import com.itboye.mengwu.data.model.LunBoModel;
import com.itboye.mengwu.data.model.ShopCarBean;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.utils.BaseErrorListener;
import com.itboye.core.utils.BaseSuccessReqListener;
import com.itboye.core.utils.ByJsonRequest.Builder;

public class LunBoRepository extends BaseNetRepository implements
		ILunBo<LunBoModel> {
	public static final String Banner = "BY_File_banner";
	String api = "100";

	public LunBoRepository(ICompleteListener listener) {
		// TODO Auto-generated constructor stub
		super(listener);
	}

	@Override
	public void add(LunBoModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(LunBoModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(LunBoModel model) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<LunBoModel> queryYouHuiQuan(LunBoModel model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void getInfo(LunBoModel model) {
		// TODO Auto-generated method stub
		String apiVer = api;
		Type type = new TypeToken<LunBoModel>() {
		}.getType();
		Map<String, Object> map = new HashMap<String, Object>();
		(new Builder<LunBoModel>())
				.setTypeVerParamsAndReturnClass(Banner, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<LunBoModel>(getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public void LunBo(int position) {
		// TODO Auto-generated method stub
		String apiVer = api;
		Type type = new TypeToken<List<LunBoModel>>() {
		}.getType();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("position", position);
		(new Builder<List<LunBoModel>>())
				.setTypeVerParamsAndReturnClass(Banner, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<LunBoModel>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

}
